﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Utils;

namespace Utils
{
    public partial class FrmQuestionDialog : Form
    {
        string Message { get; set; }
        public QuestionResult Result { get; set; }

        public FrmQuestionDialog(string message)
        {
            InitializeComponent();
            this.Message = message;
        }

        public FrmQuestionDialog(string message, string title)
        {
            InitializeComponent();
            this.Message = message;
            this.Text = title;
        }

        private void FrmQuestionDialog_Load(object sender, EventArgs e)
        {
            pbIcon.Image = System.Drawing.SystemIcons.Question.ToBitmap();
            lblMessage.Text = this.Message;
        }

        private void btnYes_Click(object sender, EventArgs e)
        {
            if (chkApplyAll.Checked)
            {
                Result = QuestionResult.YesAll;
            }
            else
            {
                Result = QuestionResult.Yes;
            }
            this.Close();
        }

        private void btnNo_Click(object sender, EventArgs e)
        {
            if (chkApplyAll.Checked)
            {
                Result = QuestionResult.NoAll;
            }
            else
            {
                Result = QuestionResult.No;
            }
            this.Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            Result = QuestionResult.Cancel;
            this.Close();
        }
    }
}
